package com.zb.sinocare.detection.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zb.sinocare.common.domain.vo.PatientVo;
import com.zb.sinocare.detection.dao.PatientMapper;
import com.zb.sinocare.detection.service.PatientService;
import com.zb.sinocare.common.domain.Patient;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient> implements PatientService {

    @Resource
    private PatientMapper patientMapper;


    @Override
    public Page selectListPage(int current, int number, PatientVo search) {
        System.out.println(search);
        Page page = new Page(current, number);
        return page.setRecords(patientMapper.query(page,search));
    }

    @Override
    public int addPatient(Patient patient) {
        return patientMapper.addPatient(patient);
    }

    @Override
    public int deletePatientById(Integer patientId) {
        return patientMapper.deletePatientById(patientId);
    }


}
